using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class FuzzyConfigForm : Form
    {
        
        public DialogResult result = DialogResult.Cancel;
        public Color color = Color.Black;
        public int iterations;
        public int groups;
        public double m;
        public double epsilon;

        public FuzzyConfigForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (colorDialog1.ShowDialog() == DialogResult.OK)
                color = colorDialog1.Color;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            result = DialogResult.Cancel;
            Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                groups = Int32.Parse(textBox1.Text);
                iterations = Int32.Parse(textBox2.Text);
                m = Double.Parse(textBox3.Text);
                epsilon = Double.Parse(textBox4.Text);
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Incorrect data.", "Incorrect data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            result = DialogResult.OK;
            Close();
        }
    }
}